<?php
/**
 * @version     1.0.0
 * @package     com_tours
 * @copyright   Copyright (C) 2013. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 * @author      kent <kent@viseed.com> - http://viseed.com
 */
// no direct access
defined('_JEXEC') or die;
$tour_list = get_cat_from_parent(9);
$app = JFactory::getApplication();
$templateDir = JURI::base() . 'templates/' . $app->getTemplate();
$tour_list = get_tours_of_tours_page();

?>
<script type="text/javascript">
    jQuery('#slidecaption').hide();
</script>

<div class="blue_line2">
	<div class="path">
<a href="#">Tours</a>
</div>
</div>

<div class="inner_content">
  <div class="content">
    <div class="left_content">
    <img src="<?php echo $templateDir;?>/images/nz_map.png" width="450" height="553" />
    </div>
    <div class="right_content">
        <?php foreach($tour_list as $obj_list){
           //get cat child
             $db = JFactory::getDbo();
             $query = $db->getQuery(true);
             $query->select('*');
             $query->from($db->quoteName('#__categories'));
             $query->where($db->quoteName('parent_id') . '=' . $obj_list->id . '');
             $db->setQuery($query);
             $result = $db->loadObjectList();
        ?>
        
   	<div class="tour_cat_title"><?php echo $obj_list->title;?></div>
        <div class="tour_cat">
        <ul>           
            <?php if($result){foreach($result as $obj){ ?>
        <li><a href="<?php echo JRoute::_('index.php?option=com_tours&view=tour&id='.$obj->id.'&Itemid=142')?>"><?php echo $obj->title;?></a></li>
            <?php }}else{?>
        <li><a href="javascript:void(0);">Updating...</a></li>
            <?php }?>
        </ul>
        </div>
        <?php }?>
        
        
    </div>
    <br class="clear" />
	</div>
</div>